home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / bsbwh.inh < prev    next >
Text File  |  1993-08-23  |  3KB  |  120 lines

  1. inst4.1
  2. !****************************************************************
  3. !*                                *
  4. !*    Brain-State-in-a-Box (Widrow-Hoff) Network Generator    *
  5. !*                                *
  6. !****************************************************************
  7.  
  8. !    *** check that input PE count is non-zero
  9.  
  10. ?&In    1
  11. >bge    CheckOut
  12. @Err    "Brain-State-in-a-Box MUST have at least one input PE"
  13. :CheckOut
  14.  
  15. !    *** Load the Control Strategy and LRS if needed
  16.  
  17. @LdCS    "hopfield"        !control strategy
  18. @LdLR    "bsbwh"            !L/R schedule
  19.  
  20. =netn    "InstaNet (tm) BSB Widrow-Hoff Network version 4.10 Sept-1992"
  21. =DLnF    0            !learn  re-display off
  22. =DRcF    0            !recall re-display off
  23.  
  24. !    *** Build the Input Layer ***
  25.  
  26. @LLdf                !load default layer to mi_layer structure
  27. =LDln    "In"            !layer name
  28. =Lpes    &In            !copy # of input PEs from menu
  29. =Ltrn    "Signum0"        !transform inputs to -1,0,+1
  30. =x    100            !place to put layer on screen
  31. =y     60
  32. #Incl    "stdnwgtf.iif"        !standard # weight fields
  33. @LAdd                !add the input layer
  34. =n0    LayN            !track previous layer
  35.  
  36. !    *** Build the Hopfield Layer ***
  37.  
  38. @LLdf                !start with default layer again
  39. =LDln    "The Brain"        !layer name
  40. =Lpes    &In            !desired number of PEs
  41. =Llrn    "BSB:Widrow-Hoff"    !learning rule
  42. =Ltrn    "BSB"            !transfer function
  43. =Llow    -1.3            !low limit for outputs
  44. =Lhgh     1.3            !high limit for outputs
  45. +y    170            !up higher on display
  46. #Incl    "stdnwgtf.iif"        !standard # weight fields
  47. @LAdd
  48.  
  49. !    *** Connect it to the input layer ***
  50.  
  51. =SPEl    LayN            !current layer
  52. @SlPE
  53. =NPEl    n0            !input layer
  54. @NrPE
  55. =cnwt    1.0            !unit weight
  56. =cnsc    WRel
  57. =cnty    WSet
  58. @LCCr                !connect corresponding items
  59.  
  60. !    *** Connect it to itself ***
  61.  
  62. =NPEl    LayN
  63. @NrPE
  64. =cnwt    0.0            !zero weights
  65. =cnty    WVar            !trainable
  66. =cnsc    WAbs
  67. =cndn    50.0            !50 % interconnection
  68. @LCRn                !Randomly connect (except diagonal)
  69. =n0    LayN            !track previous layer
  70.  
  71. !    *** Feed PEs back to themselves in this layer ***
  72.  
  73. =cnwt    1.0            !unit weight modulated by mod factor
  74. =cnty    WMod
  75. @LCCr
  76.  
  77. !    *** Build the Output Layer ***
  78.  
  79. @LLdf                !start with default layer again
  80. =LDln    "Output"        !layer name
  81. =Lpes    &In            !desired number of PEs
  82. +y    60            !up higher on display
  83. #Incl    "stdnwgtf.iif"        !standard # weight fields
  84. @LAdd
  85.  
  86. !    *** Connect the output layer back to the hopfield layer ***
  87.  
  88. =SPEl    LayN            !select output layer
  89. @SlPE
  90. =cnwt    1.0            !unit weight
  91. =cnty    WFix            !fixed
  92. =cnsc    WRel
  93. @LCCr
  94.  
  95. !    *** Select Control Strategy & L/R Schedule ***
  96.  
  97. @LLsl                !load super layer
  98. =Lctl    "hopfield"        !control strategy
  99. =Llrs    "bsbwh"            !L/R Schedule
  100. =Llnn    "bsbwh"            !name of learn input
  101. =Lrcn    "bsbwh"            !name of recall output
  102. #Incl    "stdioset.iif"        !standard I/O settings
  103. +Lflg    LAAs            !auto-associative
  104. =Lscl    -1            !input  low-value
  105. =Loff     1            !input  high-value
  106. =Llow    -1            !output low-value
  107. =Lhgh     1            !output high-value
  108. =Lax1    Epch            !epoch size
  109. @SVsl                !save it back
  110. !
  111. =Grph     1
  112. =GrLF    "bsbwh"            !instrument list file
  113. !
  114. =jogl    -.1            !lower limit for jog
  115. =jogh    +.1            !upper limit for jog
  116. =seed    257            !starting seed number
  117. @seed                !set the seed
  118. @Nrnd                !randomize the network
  119. @EOF
  120.